package com.tkmybatis.provider;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * Project_name: tk_mybatis_demo
 * Company: 新致软件
 * Author: ZHU YU WEI
 * Date: Created in 17:23 2021/4/5.
 * Description:
 * Modified By:
 */
@Component
@Slf4j
public class RabbitmqProvider {


    @Autowired
    private RabbitTemplate rabbitTemplate;

   @Scheduled(cron = "*/5 * * * * ?")
    public void providerSendMessage(){
        log.info("开始存消息");
        rabbitTemplate.convertAndSend("hello","消息内容是====朱玉伟");
    }

}
